<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">

	<rich:panel id="Edit" styleClass="form">
		
			<a4j:form ajaxSingle="true">
				<h:panelGrid>
					<div class="attributes">
				
							<s:decorate template="/layout/input.xhtml">
								<ui:define name="label">Codigo</ui:define>
								<h:inputText value="#{editFamily.editFamily.cod}"
									id="FamilyCode" 
									required="true" size="5"
									requiredMessage="Favor introduzca un codigo"
									validatorMessage="El codigo no puede ser menor a 1 o mayor a 5">
									<f:validateLength minimum="1" maximum="5" />
									<a4j:support event="onblur" />
									
								</h:inputText>
								<div class="msg_container">
								<rich:message for="FamilyCode"/>
								</div>
							</s:decorate>
							<div style="clear: both;" />
							
							<s:decorate template="/layout/input.xhtml">
								<ui:define name="label">Descripcion</ui:define>
								<h:inputText value="#{editFamily.editFamily.descrip}" label="Descripcion"
									id="FamilyDescrip" 
									required="true" size="30"
									requiredMessage="Favor introduzca el nombre de la descripcion"
									validatorMessage="El nombre no puede ser menor a 1 o mayor a 50">
									<f:validateLength minimum="1" maximum="50" />
									<a4j:support event="onblur" />
									
								</h:inputText>
								<div class="msg_container">
								<rich:message for="FamilyDescrip"/>
								</div>
							</s:decorate>
							<div style="clear: both;" />
							
							<s:decorate template="/layout/input.xhtml">
								<ui:define name="label">Grupo</ui:define>
								<h:selectOneMenu value="#{editFamily.editFamily.groupData}" id="FamilyGroup"
								required="true"
								converter="#{groupConverter}">
									<a4j:support event="onblur" />
									<s:selectItems var="gr" value="#{withinHolder.groupList()}" label="#{gr.descrip}"></s:selectItems>
								</h:selectOneMenu>
								<div class="msg_container">
									<rich:message for="FamilyGroup"/>
								</div>
							</s:decorate>
							<div style="clear: both;" />
						
							<s:decorate template="/layout/input.xhtml">
								<ui:define name="label">Activo</ui:define>
								<h:selectBooleanCheckbox value="#{editFamily.editFamily.status}" id="FamilyStatus"
								required="false" 
								validatorMessage="El estado no puede ser menor o mayor a 1"
								disabled="false">
								<a4j:support event="onblur" />
								</h:selectBooleanCheckbox>
								
								<div class="msg_container">
									<rich:message for="FamilyStatus"/>
								</div>
							</s:decorate>
					</div>
		
		
				<s:decorate template="/layout/displayButton.xhtml">
					<a4j:commandButton value="Guardar"
						action="#{editFamily.dataToEditUpd()}"
						oncomplete="#{rich:component('modalPanel')}.hide()"
						reRender="FamilyGridForm, FamilyForm" />
					<rich:spacer width="20px" />
					<a4j:commandButton value="Cancelar"
						oncomplete="#{rich:component('modalPanel')}.hide()">
					</a4j:commandButton>
				</s:decorate>
			
			</h:panelGrid>
		</a4j:form>
	</rich:panel>
</ui:composition>